<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表移动</title>
    <script src="/static/jQuery-1.11/jquery-1.11.3.min.js"></script>
</head>
<body>
<table border="1">
    <tr>
        <td>
            <select id="select1" style="width:100px;height:200px" size="10"
                    multiple="multiple">
                <option value="选项1">选项1</option>
                <option value="选项2">选项2</option>
                <option value="选项3">选项3</option>
                <option value="选项4">选项4</option>
                <option value="选项5">选项5</option>
                <option value="选项6">选项6</option>
                <option value="选项7">选项7</option>
                <option value="选项8">选项8</option>
                <option value="选项9">选项9</option>
            </select>
        </td>
        <td align="center">
            <input type="button" onclick="moveSelected('select1','select2')"
                   value="-->"/><br/>
            <input type="button" onclick="moveAll('select1','select2')"
                   value="==>"/><br/>
            <input type="button" onclick="moveSelected('select2','select1')"
                   value="<--"/><br/>
            <input type="button" onclick="moveAll('select2','select1')"
                   value="<=="/>
        </td>
        <td>
            <select id="select2" style="width:100px;height:200px" size="10"
                    multiple="multiple"></select>
        </td>
    </tr>
</table>
</body>
<script>
    function moveAll(srcId, targetId) {
        $('#' + targetId).append($("#" + srcId + " > option"));
    }
    function moveSelected(srcId, targetId) {
        $('#' + targetId).append($("#" + srcId + " > option:selected"));
    }
</script>
</html>